<template>
  <!-- 单商品banner -->
  <view class="goods-detail">
    <view class="shop-info">
      <!-- <image src="../../static/images/shop_icon.png" mode=""></image>
      <view>{{ orderitem.mch_name }}</view>
      <image :src="asyncImgs.my.icon_right_3" mode=""></image> -->
    </view>
    <view class="list-good-item">
      <view class="good-item-body">
        <image :src="orderitem.goods_pic" mode="aspectFill"></image>
        <view class="goods-info">
          <view class="goods-name">{{ orderitem.goods_name }}</view>
          <view class="goods-sku">
            <view
              style="
                font-size: 24rpx;
                color: #888;
                margin-right: 20rpx;
                display: inline-block;
              "
              v-for="(attr, attr_index) in orderitem.attr"
              :key="attr_index"
            >
              {{ attr.attr_group_name }}：{{ attr.attr_name }}
            </view>
          </view>
          <view class="goods-price">￥{{ orderitem.cost }}</view>
        </view>
      </view>
    </view>
    <!-- 客服及电话 -->
    <view class="page-footer">
      <view class="group-item">
        <image :src="asyncImgs.images.kefu_icon" alt=""></image>
        <text>{{$t('my.service')}}</text>
      </view>
      <view class="group-item">
        <image :src="asyncImgs.images.phone_icon" alt=""></image>
        <text>{{$t('order.call')}}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    orderitem: {
      type: Object,
      default: {},
    },
  },
  filters: {},
  computed: {},
  methods: {
    buyAgain(item) {
      this.$emit("buyAgain", { item: item, type: "one" });
    },
    orderRefund(item) {
      this.$emit("orderRefund", { item: item, type: "one" });
    },
  },
};
</script>

<style lang="scss" scoped>
.goods-detail {
  width: 100%;
  padding: 40rpx 0;
  background: #ffffff;
  border-radius: 24rpx;

  .shop-info {
    display: flex;
    align-items: center;
    padding: 0 36rpx;

    view {
      margin: 0rpx 10rpx;
      font-size: 28rpx;
      color: #262626;
      font-weight: 500;
      line-height: 44rpx;
    }

    image:first-child {
      width: 28rpx;
      height: 28rpx;
    }

    image:last-child {
      width: 12rpx;
      height: 20rpx;
    }
  }

  .list-good-item {
    border-bottom: 1rpx solid #f2f2f2;
    margin-top: 30rpx;
    padding: 0 36rpx 30rpx 36rpx;
    .good-item-body {
      display: flex;
      align-items: flex-start;
      justify-content: flex-start;

      image {
        width: 160rpx;
        height: 160rpx;
        border-radius: 10rpx;
        margin-right: 24rpx;
      }

      .goods-info {
        flex: 1;
        max-width: 480rpx;

        .goods-name {
          font-size: 26rpx;
          font-family: PingFang SC;
          font-weight: 400;
          color: #262626;
          line-height: 44rpx;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .goods-sku {
          font-size: 22rpx;
          font-family: PingFang SC;
          font-weight: 400;
          color: #8c8c8c;
          line-height: 26rpx;
          margin: 16rpx 0;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 2;
        }

        .goods-price {
          color: #262626;
          font-size: 26rpx;
          font-weight: 500;
          line-height: 44rpx;
        }
      }
    }

    .goods-express {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 26rpx;
      font-family: PingFang SC;
      font-weight: 400;
      color: #262626;
      margin-top: 30rpx;

      .express-info {
        display: flex;
        align-items: center;

        view {
          width: 50rpx;
          height: 26rpx;
          background: #ffffff;
          border: 1rpx solid #f27e6e;
          border-radius: 6rpx;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: 18rpx;
          font-family: PingFang SC;
          color: #f2290e;
        }

        text {
          color: #8c8c8c;
          margin-left: 16rpx;
        }
      }
    }

    .goods-btns {
      width: 100%;
      margin-top: 30rpx;
      display: flex;
      justify-content: flex-end;
      align-items: center;

      view {
        width: 152rpx;
        height: 60rpx;
        background: #ffffff;
        border: 1rpx solid #acacac;
        border-radius: 30rpx;
        font-size: 24rpx;
        font-family: PingFang SC;
        font-weight: 400;
        color: #262626;
        text-align: center;
        line-height: 60rpx;
      }

      view:last-child {
        margin-left: 24rpx;
      }
    }
  }

  .list-good-item:last-child {
    border-bottom: 0 none;
  }

  .page-footer {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 30rpx 0 4rpx 0;
    // border-top: 1rpx solid #f2f2f2;

    .group-item {
      display: flex;
      justify-content: center;
      align-items: center;
      flex: 1;

      image {
        width: 28rpx;
        height: 28rpx;
        display: block;
        margin-right: 14rpx;
      }

      text {
        font-size: 26rpx;
        color: #262626;
        line-height: 44rpx;
      }
    }

    .group-item:last-child {
      border-left: 2rpx solid #f2f2f2;
    }
  }
}
</style>
